package me.zhengjie.modules.housetype.domain;

import me.zhengjie.base.CommonModel;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.IdType;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
import javax.validation.constraints.*;
import java.math.BigDecimal;
import java.io.Serializable;
import java.util.Date;
import java.sql.Timestamp;

/**
* @author TianI
* @date 2022-01-29
*/
@Data
@Builder
@Accessors(chain = true)
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode(callSuper = false)
@TableName("house_type")
public class HouseType extends CommonModel<HouseType> implements Serializable {
    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "户型表主键id")
    @TableId(type= IdType.ASSIGN_ID)
    private Long houseTypeId;

    @ApiModelProperty(value = "关联房产项目")
    @NotNull
    private Long realEstateProjectId;

    @ApiModelProperty(value = "户型名称")
    @NotBlank
    private String houseTypeName;

    @ApiModelProperty(value = "户型图片url")
    @NotBlank
    private String houseTypeUrl;

    @ApiModelProperty(value = "户型价格")
    @NotNull
    private String houseTypePrice;

    @ApiModelProperty(value = "户型价格单位")
    @NotBlank
    private String houseTypePriceUnit;

    @ApiModelProperty(value = "户型类型")
    @NotBlank
    private String houseType;

    @ApiModelProperty(value = "户型分布")
    @NotBlank
    private String houseTypeDistribution;

    @ApiModelProperty(value = "户型解析")
    @NotBlank
    private String houseTypeAnalysis;

    @ApiModelProperty(value = "户型分类（几室）")
    @NotBlank
    private String houseTypeCategory;

    public void copyFrom(HouseType source){
        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
    }
}
